home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / FORTGAME.DIR / 00276_Script_Inventory < prev    next >
Text File  |  1996-03-20  |  3KB  |  104 lines

  1.  on acquireObject objectName
  2.   global item1Sprite, item2Sprite, item3Sprite
  3.   global item1Name, item2Name, item3Name
  4.   if        item1Name = empty then
  5.     set item1Name = "inventoryItem "&objectName
  6.     puppetSprite item1Sprite, true
  7.     set the castNum of sprite item1Sprite = the number of cast item1Name
  8.     setGrabObjectCursor item1Sprite
  9.   else   if item2Name = empty then
  10.     set item2Name = "inventoryItem "&objectName
  11.     puppetSprite item2Sprite, true
  12.     set the castNum of sprite item2Sprite = the number of cast item2Name
  13.     setGrabObjectCursor item2Sprite
  14.   else   if item3Name = empty then
  15.     set item3Name = "inventoryItem "&objectName
  16.     puppetSprite item3Sprite, true
  17.     set the castNum of sprite item3Sprite = the number of cast item3Name
  18.     setGrabObjectCursor item3Sprite
  19.   else
  20.     return false
  21.   end if
  22.   resetSpriteCursor (the clickOn)
  23.   return true
  24. end acquireObject
  25.  
  26. on ClickInventoryItem whichSprite
  27.   global currentList, currentListLine
  28.   put getFrameFromListLine (currentList, currentListLine) into currentPos
  29.   
  30.   if (currentpos = "R 7") and (objectInInventory ("BackwardNote") = whichSprite) then
  31.     useObject whichSprite
  32.     dissolve 2 
  33.     go "Reveal Backward Note"
  34.   end if
  35.   
  36.   if (currentpos = "R 9") and (objectInInventory ("Snorkel1") = whichSprite) then
  37.     useObject whichSprite
  38.     dissolve 2
  39.     go "Attach Snorkel"
  40.   end if
  41.   
  42.   if (currentpos = "A 3 D") and (objectInInventory ("Key1") = whichSprite) then
  43.     useObject whichSprite
  44.     UnlockDoor 3
  45.     OpenDoor 3
  46.   end if
  47.   
  48.   if (currentpos = "B 7 D") and (objectInInventory ("Key2") = whichSprite) then
  49.     useObject whichSprite
  50.     UnlockDoor 7
  51.     OpenDoor 7
  52.   end if
  53.   
  54.   if (currentpos = "R 13") and (objectInInventory ("Key3") = whichSprite) then
  55.     useObject whichSprite
  56.     global trunkOpen
  57.     set trunkOpen = true
  58.     rPlaySound "Trunk"
  59.     go frame "TrunkOpen"
  60.     WaitSound
  61.   end if
  62.   
  63.   if (currentpos = "C 23 D") and (objectInInventory ("Key4") = whichSprite) then
  64.     useObject whichSprite
  65.     UnlockDoor 23
  66.     OpenDoor 23
  67.   end if
  68.   
  69. end ClickInventoryItem
  70.  
  71. on useObject whichSprite
  72.   set the castNum of sprite whichSprite = emptyCastNumber()
  73.   
  74.   global item1Sprite, item2Sprite, item3Sprite
  75.   global item1Name, item2Name, item3Name
  76.   
  77.   if      whichSprite = item1Sprite then
  78.     set item1Name = empty
  79.     resetSpriteCursor item1Sprite
  80.   else if whichSprite = item2Sprite then
  81.     set item2Name = empty
  82.     resetSpriteCursor item2Sprite
  83.   else if whichSprite = item3Sprite then
  84.     set item3Name = empty
  85.     resetSpriteCursor item3Sprite
  86.   end if
  87.   
  88. end useObject
  89.  
  90. on objectInInventory objectName
  91.   -- returns 0 if not found, else returns sprite number
  92.   global item1Sprite, item2Sprite, item3Sprite
  93.   global item1Name, item2Name, item3Name
  94.   if        item1Name = "InventoryItem "&objectName then
  95.     return item1Sprite
  96.   else   if item2Name = "InventoryItem "&objectName then
  97.     return item2Sprite
  98.   else   if item3Name = "InventoryItem "&objectName then
  99.     return item3Sprite
  100.   else
  101.     return false
  102.   end if
  103. end objectInInventory
  104.